package jsen.tool.ddd.demo.domain.parking.spec.parking;

import jsen.tool.ddd.adapter.infrastructure.specification.ISpecification;
import jsen.tool.ddd.adapter.infrastructure.specification.base.SpecContext;
import jsen.tool.ddd.demo.domain.parking.ParkingLot;

/**
 * @author jsen
 * @date 2021/10/6
 */
public class ParkingLotSpec implements ISpecification<ParkingLot> {
    @Override
    public boolean isSatisfiedBy(SpecContext<ParkingLot> t) {
        return t.getData().getParkingLotStatus().getStrict()
                .isSatisfiedBy(t.subContext(ParkingLot::getParkingLotStatus));
    }
}
